package org.jypj.dev.task;

import javax.annotation.Resource;

import org.jypj.dev.service.ICountTaskService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 统计的定时器
 * 
 * @author ChenYu
 *
 */
@Component
public class CountTask {

	@Resource
	private ICountTaskService countTaskService;
	
	/**
	 * 计算用户车次分数
	 */
	@Scheduled(cron = "0 40 1 * * ?")
	public void doSaveUserTrainWorkScore(){
		try {
			countTaskService.countUserTrainScore();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	/**
	 * 隔一天计算前一天的用户
	 */
	@Scheduled(cron = "0 50 1 * * ?")
	public void doSaveUserScore(){
		try {
			countTaskService.countUserScore();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}

}
